package example;

import framework.AutomatonPlugin;
import framework.Board;
import framework.State;
import framework.StateCalculator;

/**
 * A concrete AugomatonPlugin for example
 * 
 * @author jtumarki, ntibrewa, shuaihan, wesleyk
 */
public class AutomatonImpl implements AutomatonPlugin {

	/**
	 * /* used for calculating state transitions
	 */
	private StateCalculator myCalculator;

	/**
	 * Constructor for AutomatonPlugin implementation
	 */
	public AutomatonImpl() {
		myCalculator = new ConwayCalculator();
	}

	/**
	 * @return all types of defined states
	 */
	@Override
	public State[] getAllStates() {
		State[] toReturn = new State[2];
		toReturn[0] = (new DeadState());
		toReturn[1] = (new AliveState());
		return toReturn;
	}

	/**
	 * @return the game's calculator
	 */
	@Override
	public StateCalculator getStateCalculator() {
		return myCalculator;
	}

	/**
	 * Initial board of the game, got from InitialBoard, which contains a
	 * library of initial boards
	 * @return example board
	 */
	@Override
	public Board initialBoard() {
		return InitialBoard.createGliderBoard();
	}
}
